﻿using Conqueror.WP.Utility;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Conqueror.WP.ViewModel.Login
{
    public class LoginViewModel : ViewModel
    {
        private string loginMessage = "";
        public string LoginMessage
        {
            get { return loginMessage; } 
            set { 
                if (loginMessage != value)
                {
                    loginMessage = value;
                    Notify("LoginMessage");
                }
            }
        }

        public string Username
        {
            get { return User.Username; }
            set
            {
                if (User.Username != value)
                {
                    User.Username = value;
                    Notify("Username");
                }
            }
        }

        private bool enabled = true;
        public bool Enabled
        {
            get { return enabled; }
            set
            {
                if (enabled != value)
                {
                    enabled = value;
                    Notify("Enabled");
                }
            }
        }

        private string failureMessage = "is your username correct?";
        public string FailureMessage
        {
            get { return failureMessage; }
        }

        public LoginViewModel()
        {
            Random r = new Random();
            switch(r.Next(6))
            {
                default:
                case 0: failureMessage = "is your username correct?"; break;
                case 1: failureMessage = "are you connected to the internet?"; break;
                case 2: failureMessage = "are you sure your spelling is correct?"; break;
                case 3: failureMessage = "check your spelling and try again"; break;
                case 4: failureMessage = "do you have a conquer club account?"; break;
                case 5: failureMessage = "is that your conquer club username?"; break;
            }
        }
    }
}
